package com.leedsoft.service.entity;

import com.leedsoft.common.Enums;
import com.leedsoft.controller.vo.TaskJsonVo;
import com.leedsoft.domain.AidBpmNode;

/**
 * Created by leeds on 2017/6/20.
 */
public class OverStep extends Step{
    @Override
    public void wireCoreNode(AidBpmNode node) {
        TaskJsonVo task = stepVo.getTaskJsonList().get(0);
        node.setAssignee(task.getAssignee());
        node.setType(Enums.NodeType.TASK.getCode().shortValue());
        node.setBrief(task.getBrief() == null ? "结束" : task.getBrief());
        task.setCode(node.getCode());
        task.setHas_to((short)1);
    }

    @Override
    public void genViceNodes() {
        AidBpmNode node = newNode();
        node.setType(Enums.NodeType.OVER.getCode().shortValue());
        nodeMapper.insertSelective(node);

        newFlow(coreNode.getCode(), node.getCode());
    }
}
